@echo off  
rem 当前bat的作用  
   
echo ==================begin========================  
   
cls   
SET NGINX_PATH=D:  
SET NGINX_DIR=D:\Soft\Nginx\
color 0a   
TITLE Nginx Program 
GOTO restart  
   
:restart   
    call :shutdownNginx  
    call :startNginx   
    EXIT
   
:shutdownNginx  
    ECHO.   
    ECHO.Close Nginx......   
    taskkill /F /IM nginx.exe > nul  
    ECHO.OK,Close All nginx
   
:startNginx  
    ECHO.   
    ECHO.Start Nginx......   
    IF NOT EXIST "%NGINX_DIR%nginx.exe" ECHO "%NGINX_DIR%nginx.exe"NotFind   
   
    %NGINX_PATH%   
   
    cd "%NGINX_DIR%"   
    ECHO.Delete Log......  
    cd logs  
    del /F /S /Q *.*  
    cd "%NGINX_DIR%"  
   
    IF EXIST "%NGINX_DIR%nginx.exe" (  
        echo "start '' nginx.exe"  
        start "" nginx.exe  
    )  
    ECHO.OK  

